<template>
  <div id="app">
    <div v-if="showNav">
      <van-nav-bar :title="title" :left-arrow="showleftArrow" @click-left="onClickLeft"/>
    </div>
    <keep-alive :include="include">
      <router-view/>
    </keep-alive>
  </div>
</template>

<script>
export default {
  data(){
    return {
      include: ["login"],
    }
  },
  computed: {
    title() {
      return this.$route.meta.title || ""
    },
    showleftArrow() {
      if (["/", "/videoRoom"].includes(this.$route.path)) return false;
      return true
    },
    showNav() {
      if (["/videoRoom"].includes(this.$route.path)) return false;
      return true
    },
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
      console.log("返回了")
    },
  },
};
</script>
<style lang="scss">
html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  display: flex;
  flex-direction: column;
  //height: 100%;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
.login-btn {
  width: 100%;
  border: none;
  margin-top: 20px;
  border-radius: 4px;
  //background: #0473EA !important;
}
.van-popup--bottom{
  width: 96% !important;
  left: 2% !important;
}
.van-popup--bottom.van-popup--round {
  border-radius: 8px 8px 0 0 !important;
}
.van-action-sheet__gap {
  background-color: #474747 !important;
}
.van-action-sheet__item {
  border-top: 1px solid #eeeeee !important;
}
.van-dialog__confirm, .van-dialog__confirm:active {
  color: #0473EA !important;
}
</style>
